{% load static %}
{% get_static_prefix as STATIC_PREFIX %}

{% load thumbnail %}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
{% if mobile %} <!---------- mobile web ---------->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="{{ STATIC_PREFIX }}images/m/icon.png"/>
{% else %} <!---------- web ---------->
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ROBOTS" content="ALL" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="Copyright" content="BrisbaneCoupon" />
<meta name="keywords" content="Brisbane, Coupon" />
{% endif %}
<link href="{{ STATIC_PREFIX }}images/d/icon.ico" rel="shortcut icon" type="image/x-icon">
 
<title>{% block title %}{% endblock %}</title>

{% load compress %}
{% block stylesheet %}

{% if mobile %} <!---------- mobile web ---------->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<!-- 
<link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/m/all_v2_mobile.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/m/jquery.mobile-1.1.min.css" />
-->
{% else %} <!---------- web ---------->
{% compress css %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/d/all_v2.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/d/sticky.full.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_PREFIX }}css/d/smoothness/jquery-ui-1.8.23.custom.css" />
{% endcompress %}
{% endif %}
{% endblock %}

{% block javascript %}

{% if mobile %} <!---------- mobile web ---------->
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/jquery-1.7.1.min.js" ></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
{% else %} <!---------- web ---------->
{% compress js %}
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/jquery.sticky.js"></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/scrollup.js" ></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/sticky.full.js" ></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/jquery-ui-1.8.23.custom.min.js" ></script>
<!-- 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/jquery-1.6.4.min.js" ></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/bootstrap-dropdown.js" ></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/scrollup.js" ></script>
<script type="text/javascript" src="{{ STATIC_PREFIX }}js/d/jquery.pop.js" ></script>
 -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32230259-1']);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function tkstickyMsg(msg, result) {
    var pic = "";
    if(result == "good") {
        pic = "{{ STATIC_PREFIX }}images/d/icon_menu_over_coupon.png";
    } else if (result == "bad") {
        pic = "{{ STATIC_PREFIX }}images/d/icon_menu_coupon.png";
    } else if (result == "info") {
    	pic = "{{ STATIC_PREFIX }}images/d/help.png";
    } else {
    	pic = "{{ STATIC_PREFIX }}images/d/help.png";
    }
    var msg = '<img src="' + pic + '" style="height:48px;float:left;">' +
              '<p style="margin:0;padding:0;margin-left:60px;font-size:13px;font-style:italic;"><b>' +
              msg +
              '</b></p>';
    $.tksticky(msg);
}

$(document).ready(function() {
    $("#hb-gotop").scrollToTop();
    $("#dNav").sticky({ topSpacing: 0, className: 'sticky', wrapperClassName: 'my-wrapper' });
    
    $("#id_q").autocomplete({
        source: "{% url lookup %}",
        selectFirst:true,
        minLength:1
    });
    
});
</script>
{% endcompress %}
{% endif %}
{% endblock %}
</head>

<body>
  {% if mobile %} <!---------- mobile web ---------->
  <div id="mobile-content" data-role="page" data-add-back-btn="true">
    <div data-role="header" data-theme="f">
        <h1>
        <a href="{% url mindex %}"><img src="{{ STATIC_PREFIX }}images/m/brisbane_coupon_logo.png"></a>
        </h1>
      {% if user.is_authenticated %}
      <a href="{% url user_info %}" data-direction="reverse" class="ui-btn-right jqm-home">{{ user.username }}</a>
      {% else %}
      <a href="{% url auth_login %}" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
      {% endif %}
    </div><!-- /header -->
    <div data-role="footer">
      <div data-role="navbar" data-iconpos="bottom">
        <ul>
          <li><a href="{% url mevents %}" {% ifequal m_current_page "event" %} class="ui-btn-active" {% endifequal %} data-icon="check">Event</a></li>
          <li><a href="{% url mstores %}" {% ifequal m_current_page "store" %} class="ui-btn-active" {% endifequal %} data-icon="check">Store</a></li>
          <li><a href="{% url mcoupons %}" {% ifequal m_current_page "coupon" %} class="ui-btn-active" {% endifequal %}  data-icon="check">Coupon</a></li>
          <li><a href="{% url mrecruits %}" {% ifequal m_current_page "recruit" %} class="ui-btn-active" {% endifequal %} data-icon="check">Recruit</a></li>
        </ul>
      </div><!-- /navbar -->
    </div><!-- /footer -->
    <div data-role="content"> 
    
    
  {% else %} <!---------- web ---------->
  <div id="dHeader">
    <div id="dHeaderTitle">
      <div id="dTopheader">
        <div id="dLogo">
          <a href="{% url index %}"><img src="{{ STATIC_PREFIX }}images/d/brisbane_coupon_logo.png" width="265" alt="Brisbane Coupon"></a>
        </div> <!-- end dLogo -->
        <div id="dMember">
          <ul>
            {% if user.is_authenticated %}
            <li><a href="{% url user_info %}">{{ user.username }}</a></li>
            <li><a href="{% url auth_logout %}" class="cLogin">Log out</a></li>
            {% else %}
            <li><a href="{% url auth_login %}" class="cLogin">Login</a></li>
            <li><a href="{% url registration_register %}" class="cSignUp"> Signup </a></li>
            {% endif %}
          </ul>
        </div> <!-- end dMember -->
      </div> <!-- end dTopheader -->
    </div> <!-- end dHeaderTitle -->
    <div id="dNav">
      <nav>
        <ul>
          <li><a href="{% url stores %}" {% ifequal current_page "store" %}class="cStoreHover"{% else %}class="cStore"{% endifequal %}>Store</a></li>
          <li><a href="{% url stores_map %}" {% ifequal current_page "map" %}class="cStoreMapHover"{% else %}class="cStoreMap"{% endifequal %}> Store Map </a></li>
          <li><a href="{% url events %}" {% ifequal current_page "event" %}class="cEventHover"{% else %}class="cEvent"{% endifequal %}>Event</a></li>
          <li><a href="{% url coupons %}" {% ifequal current_page "coupon" %}class="cCouponHover"{% else %}class="cCoupon"{% endifequal %}>Coupon</a></li>
          <li><a href="{% url recruits %}" {% ifequal current_page "recruit" %}class="cJobHover"{% else %}class="cJob"{% endifequal %}>Recruit</a></li>
        </ul>
        <div id="dSM">
		  <a href="https://twitter.com/brisbanecoupon" class="twitter-follow-button" data-show-count="false">Follow @brisbanecoupon</a>
		  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
		</div> <!-- end dSM-->
      </nav>
    </div> <!-- end dNav-->
  </div> <!-- end dHeader-->

  {% block ad %}
  <div id="dAdHome">
    <h4>Brisbane AD</h4>
    <div id="dAdin">
      <ul>
        {% for e in sevents %}
          {% thumbnail e.sideimage "135x202" as im %}
          <a href="{{ e.url }}"><img src="{{ im.url }}" alt="{{ e.name }} - {{ e.store.name }}" /></a>
          {% endthumbnail %}
        {% endfor %}
      </ul>
    </div> <!-- End of Left dAdin-->
  </div> <!-- End of dAdHome -->
  {% endblock %}
  {% endif %}
  
  {% block content %}
  {% endblock %}
  
  {% if mobile %}  <!---------- mobile web ---------->
    </div><!-- content -->
  </div><!-- page -->
  {% else %} <!---------- web ---------->
  <a style="" id="hb-gotop">Scroll to Top</a>
  
  <footer>
    <div id="dFooter"> &copy;
    2012 <a href="{% url contract %}">GLUEE</a>
    <div id="dFooterAd"><a href="{% url contract %}">광고문의</a></div>
    </div>
  </footer>
  {% endif %}
</body>
</html>
